<template>
    <div style="position: relative;">
        <!-- 导航栏开始 -->
		
        <div v-if="data.banner_in_back == 1" class='di'>
            <img src="@/image/model/banner.jpg" :style="{width:data.img_width,height:data.img_height}">
        </div>
		<div v-else class="di" :style="{background: 'linear-gradient(to left, '+data.background[0]+','+data.background[1]+')'}">
		</div>
        <!-- 导航栏结束 -->
    </div>
</template>

<script>

    export default {
         name: 'ItemBackground',
        data(){
            return{
                data:{ 
                    banner_in_back:0,//判断是否用图片
                    background:['#014aff','#039dff'],//渐变背景颜色
                    img_width:'289px',//图片宽度
                    img_height:'168px',//图片高度
                }
            }
        }
     
	
    }
</script>

<style >
   .di {
       width: 300px;
       height: 125px;
       position: absolute;
       top: 0;
       left: 0;
       z-index: 0;
        
   }
  
</style>
